package com.guo.todo.usercenter.config;

import com.guo.todo.usercenter.filter.CommonFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Auther: hotlove_linx
 * @Date: 2023/7/23 20:10
 * @Description:
 */
@Configuration
public class FilterConfig {
    @Bean
    public FilterRegistrationBean<CommonFilter> registerCommonFilter() {
        FilterRegistrationBean<CommonFilter> registration = new FilterRegistrationBean<>();
        registration.setFilter(new CommonFilter());
        registration.addUrlPatterns("/*");
        registration.setName("CommonFilter");
        registration.setOrder(1);
        return registration;
    }
}
